package cn.zhxu.research;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class Cutter {

    private static final Logger log = LoggerFactory.getLogger(Cutter.class);

    public static void main(String[] args) throws IOException {
        log.info("开始处理...");
        var dataItems = DataItem.readDataItems("E:/SpaceMine/research/data/dataset_full.txt");
        var newCnt = dataItems.size() / 4;
        try (BufferedWriter writer = new BufferedWriter(new FileWriter("E:/SpaceMine/research/data/dataset.txt"))) {
            for (int i = 0; i < newCnt; i++) {
                var item = dataItems.get(4 * i + 1);
                writer.write(item.getTxt1() + "##" + item.getTxt2() + "##" + item.getScore());
                writer.newLine();
                item = dataItems.get(4 * i + 3);
                writer.write(item.getTxt1() + "##" + item.getTxt2() + "##" + item.getScore());
                writer.newLine();
            }
        }
        log.info("开始处理！");
    }

}
